package com.mingdong.first.mingling;

import com.mingdong.first.mingling.commond.Commond;
import com.mingdong.first.mingling.commond.LightOffCommond;
import com.mingdong.first.mingling.commond.LightOnCommond;
import com.mingdong.first.mingling.commond.MarcoCommond;
import com.mingdong.first.mingling.commond.StereoOffCommond;
import com.mingdong.first.mingling.commond.StereoOnCommond;
import com.mingdong.first.mingling.commond.StereoVolAdd;
import com.mingdong.first.mingling.commond.StereoVolSub;
import com.mingdong.first.mingling.control.CommanModeControl;
import com.mingdong.first.mingling.device.Light;
import com.mingdong.first.mingling.device.Stereo;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		CommanModeControl control = new CommanModeControl();
		
		Light bedroomLight = new Light("bedroom");
		Light kitchenLight = new Light("kitchen");
		Stereo stereo = new Stereo();
		
		LightOnCommond bedroomlighton = new LightOnCommond(bedroomLight);
		LightOnCommond kitchenlighton = new LightOnCommond(kitchenLight);
		LightOffCommond bedroomlightoff = new LightOffCommond(bedroomLight);
		LightOffCommond kitlightoff = new LightOffCommond(kitchenLight);
		
		Commond[] onCommonds = {bedroomlighton,kitchenlighton};
		Commond[] offCommonds = {bedroomlightoff,kitlightoff};		
		MarcoCommond onMarcoCommond = new MarcoCommond(onCommonds);
		MarcoCommond offMarcoCommond = new MarcoCommond(offCommonds);
		
		StereoOnCommond stereoon = new StereoOnCommond(stereo);
		StereoOffCommond stereooff = new StereoOffCommond(stereo);
		StereoVolAdd stereoVolAdd = new StereoVolAdd(stereo);
		StereoVolSub stereoVolSub = new StereoVolSub(stereo);
		
		control.setCommon(0, bedroomlighton, bedroomlightoff);
		control.setCommon(1, kitchenlighton, kitlightoff);
		control.setCommon(2, stereoon, stereooff);
		control.setCommon(3, stereoVolAdd, stereoVolSub);
		control.setCommon(4, onMarcoCommond, offMarcoCommond);
		
		control.onButton(1);
		control.undoButton();
	}

}
